﻿/*
	debug>info>warn>error
	日志记录 大于等于 自己等级的日志
*/
#ifndef BROWSERLOG_H
#define BROWSERLOG_H
#pragma once
#include "string"
using namespace std;
const string JKDEBUG = "Debug";
const string JKINFO = "Info";
const string JKWARN = "Warn";
const string JKERROR = "Error";
enum LOGLEVEL
{
	ERRORLOG,
	WARNLOG,
	INFOLOG,
	DEBUGlOG
};
class JkLog
{
public:
	JkLog();
	JkLog(int logLevel, string filename);
	~JkLog();


	string m_logfilename;
	int m_loglevel;
	void setLevel(int logLevel);
	void writelog(const char* data, string level);
	void writelog(const std::wstring data, string level);

	void DebugLog(const char* data);
	void DebugLog(const std::wstring data);
	void DebugLogW(const std::wstring data);

	void InfoLog(const char* data);
	void InfoLog(const std::wstring data);
	void InfoLogW(const std::wstring data);

	void WarnLog(const char* data);
	void WarnLog(const std::wstring data);
	void WarnLogW(const std::wstring data);

	void ErrorLog(const char* data);
	void ErrorLog(const std::wstring data);
	void ErrorLogW(const std::wstring data);

	// 替换敏感字段
	void ReplaceSensitiveText(std::string& data);
};
#endif
